<!-- 代表总览 -->
<template>
  <div class="content">
    <Title> 代表总览 </Title>
    <div class="number_box">
      <div class="list">
        <img src="@/assets/images/left/kuangkuang.svg" alt="" srcset="">
        <div class="list_box">
          <div class="title">
            全部代表
          </div>
          <div class="number">
            123<span>个</span>
          </div>
        </div>
      </div>
      <div class="list">
        <img src="@/assets/images/left/kuangkuang.svg" alt="" srcset="">
        <div class="list_box">
          <div class="title">
            省代表
          </div>
          <div class="number">
            123<span>个</span>
          </div>
        </div>
      </div>
      <div class="list">
        <img src="@/assets/images/left/kuangkuang.svg" alt="" srcset="">
        <div class="list_box">
          <div class="title">
            市代表
          </div>
          <div class="number">
            123<span>个</span>
          </div>
        </div>
      </div>
      <div class="list">
        <img src="@/assets/images/left/kuangkuang.svg" alt="" srcset="">
        <div class="list_box">
          <div class="title">
            乡镇代表
          </div>
          <div class="number">
            123<span>个</span>
          </div>
        </div>
      </div>
    </div>
    <div id="main" style="width:100%;height: 224px;"></div>
  </div>

</template>

<script>
import Title from '@/components/template/title.vue'
import * as echarts from 'echarts';
export default {
  name: '',
  data() {
    return {
      option: {
        tooltip: {
          trigger: 'item'
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            label: {
              color: 'white'
            },
            radius: ['40%', '70%'],
            data: [
              { value: 1048, name: 'Search Engine' },
              { value: 735, name: 'Direct' },
              { value: 580, name: 'Email' },
              { value: 484, name: 'Union Ads' },
              { value: 300, name: 'Video Ads' }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      }
    }
  },
  components: {
    Title
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      var chartDom = document.getElementById('main');
      var myChart = echarts.init(chartDom);
      this.option && myChart.setOption(this.option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    }
  },
}

</script>
<style lang='scss' scoped>
.content {
  width: 470px;
  height: 504px;

  .number_box {

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;

    .list {
      display: flex;
      width: 180px;
      height: 72px;

      margin: 20px;

      img {
        margin-right: 13px;
        float: left;
      }

      .list_box {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        height: 100%;

        .title {
          /** 文本1 */
          font-size: 18px;
          font-weight: 400;
          letter-spacing: 2.96px;
          line-height: 23.76px;
          color: rgba(143, 171, 191, 1);
          vertical-align: top;
        }

        .number {
          font-size: 30px;
          font-weight: 700;
          letter-spacing: 2.91px;
          line-height: 39.59px;
          color: rgba(255, 255, 255, 1);

          span {
            font-size: 15.23px;
            font-weight: 500;
            letter-spacing: 1.59px;
            line-height: 22.05px;
            color: rgba(131, 146, 154, 1);
          }
        }

      }
    }

  }
}
</style>